/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author aasharm2
 */
public class TipForms extends org.apache.struts.action.ActionForm {

    private int numguest=1;
    private int servicequal;
    private float billtotal;
    private float  billdeductions;
    private float tax;
    private float tiprate;
    private float totaltip;
    private String tipperperson;
    private float total;
    private float mintip = 0;
    private float maxtip = 40;
    private String inculdeded="Y";
    private String inculdetax="Y";
    private String sliderpos;

    public String getSliderpos() {
        return sliderpos;
    }

    public void setSliderpos(String sliderpos) {
        this.sliderpos = sliderpos;
    }
    

    public int getNumguest() {
        return numguest;
    }

    public void setNumguest(int numguest) {
        this.numguest = numguest;
    }

    public int getServicequal() {
        return servicequal;
    }

    public void setServicequal(int servicequal) {
        this.servicequal = servicequal;
    }

    public float getBilltotal() {
        return billtotal;
    }

    public void setBilltotal(float billtotal) {
        this.billtotal = billtotal;
    }

    public float getBilldeductions() {
        return billdeductions;
    }

    public void setBilldeductions(float billdeductions) {
        this.billdeductions = billdeductions;
    }

    public float getTax() {
        return tax;
    }

    public void setTax(float tax) {
        this.tax = tax;
    }

    public float getTiprate() {
        return tiprate;
    }

    public void setTiprate(float tiprate) {
        this.tiprate = tiprate;
    }

    public float getTotaltip() {
        return totaltip;
    }

    public void setTotaltip(float totaltip) {
        this.totaltip = totaltip;
    }

    public String getTipperperson() {
        return tipperperson;
    }

    public void setTipperperson(String tipperperson) {
        this.tipperperson = tipperperson;
    }

    public float getTotal() {
        return total;
    }

    public void setTotal(float total) {
        this.total = total;
    }

    public float getMintip() {
        return mintip;
    }

    public void setMintip(float mintip) {
        this.mintip = mintip;
    }

    public float getMaxtip() {
        return maxtip;
    }

    public void setMaxtip(float maxtip) {
        this.maxtip = maxtip;
    }

    public String getInculdeded() {
        return inculdeded;
    }

    public void setInculdeded(String inculdeded) {
        this.inculdeded = inculdeded;
    }

    public String getInculdetax() {
        return inculdetax;
    }

    public void setInculdetax(String inculdetax) {
        this.inculdetax = inculdetax;
    }
    

    

    /**
     *
     */
    public TipForms() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getNumguest() == 0 || getNumguest() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }
}
